using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Net;
using System.Text;
using BookDownloader.Core.Data;

namespace BookDownloader.Core.Implementation
{
  [Serializable]  
	public class FantlabWebRatesProvider : FantlabRatesProviderBase
    {
        public FantlabWebRatesProvider(List<MappedBook> myBooks) : base(myBooks)
        {
        }

        protected override string LoadRawRates()
        {
            string url = ConfigurationManager.AppSettings["FantlabDataPath"];
            WebRequest request = WebRequest.Create(url);
            WebResponse response = request.GetResponse();
            Stream stream = response.GetResponseStream();
            Encoding encode = Encoding.GetEncoding("windows-1251");
            StreamReader rd = new StreamReader(stream, encode);
            string s = rd.ReadToEnd();
            return s;
        }

    }
}